import { request } from "@/utils/request";

export default class Index {
    // 维修 列表
    static getList(query) {
        return request({
            url: "/adient-pms/pad/deviceRepairRecord/page",
            method: "get",
            params: query,
        });
    }
    static getListPlan(query) {
        return request({
            url: "/adient-pms/pc/deviceMaintenceStrategy/page",
            method: "get",
            params: query,
        });
    }
    //维修 新增
    static deviceAdd(params) {
        return request({
            url: "/adient-pms/pad/deviceRepairRecord/add",
            method: "post",
            params,
        });
    }
    //维修 详情
    static devicedetail(no) {
        return request({
            url: `/adient-pms/pad/deviceRepairRecord/loadByNo/${no}`,
            method: "get",
        });
    }

    //维修 确认取消
    static repairConfirmed(no) {
        return request({
            url: `/adient-pms/pad/deviceRepairRecord/repairConfirmed/${no}`,
            method: "put",
        });
    }

    // 保养详情 备件领用单
    static waitCheckListByUser(query) {
        return request({
            url: `/adient-pms/pc/toolIoRecord/waitCheckListByUser`,
            method: "get",
            params: query,
        });
    }

    // 保养详情 备件领用单
    static dictDetails(query) {
        return request({
            url: `/admin-v3/dictDetail/page`,
            method: "get",
            params: query,
        });
    }
    // 字典工区
    static dictDetailsList(query) {
        return request({
            url: `/admin-v3/dictDetail/list`,
            method: "get",
            params: query,
        });
    }

    //任务大厅确认受理任务
    static accepted(query) {
        return request({
            url: "/adient-pms/pad/deviceRepairRecord/accepted",
            method: "put",
            params: query,
        });
    }
    static batchApprovalApi(query) {
        return request({
            url: "/adient-pms/pc/deviceMaintenceStrategy/batchApproval",
            method: "put",
            params: query,
        });
    }
    //受理任务开始
    static repairing(no) {
        return request({
            url: `/adient-pms/pad/deviceRepairRecord/repairing/${no}`,
            method: "put",
        });
    }
    //受理任务完成确认
    static repair(query) {
        return request({
            url: "/adient-pms/pad/deviceRepairRecord/repair",
            method: "put",
            params: query,
        });
    }
    //受理任务取消
    static cancelRepair(query) {
        return request({
            url: "/adient-pms/pad/deviceRepairRecord/cancelRepair",
            method: "put",
            params: query,
        });
    }
    //更具no查找设备信息
    static getDeviceByNo(query) {
        return request({
            url: "/adient-pms/pc/deviceInfo/getDeviceByNo",
            method: "get",
            params: query,
        });
    }
    //设备类型

    static getDeviceType(type) {
        return request({
            url: "/admin-v3/dictDetail/list?code=" + type,
            method: "get",
        });
    }
    //设备编号
    static getDeviceList(query) {
        return request({
            url: "/adient-pms/pc/deviceInfo/getDeviceList",
            method: "get",
            params: query,
        });
    }

    //设备编号位置查询
    static getByDeviceCode(deviceCode) {
        return request({
            url: "/adient-pms/pc/deviceLocation/getByDeviceCode?deviceCode=" + deviceCode,
            method: "get",
        });
    }

    //设备位置查询
    static getDeviceByLocationCode(locationCode) {
        return request({
            url: "/adient-pms/pc/deviceLocation/getDeviceByLocationCode/" + locationCode,
            method: "get",
        });
    }

    //转派 人
    static getPersonnel(query) {
        return request({
            url: "/adient-pms/pad/deviceRepairRecord/personnel",
            method: "get",
            params: query,
        });
    }

    //转派 人 确定
    static setTransfe(query) {
        return request({
            url: "/adient-pms/pad/deviceRepairRecord/transfer",
            method: "get",
            params: query,
        });
    }

    static getByDeviceCodeAndType(query) {
        return request({
            url: "/adient-pms/pc/deviceLocation/getByDeviceCode",
            method: "get",
            params: query,
        });
    }

    // 审批 列表
    static approvalStatus(query) {
        return request({
            url: "/adient-pms/pc/deviceRepairRecord/approvalStatus",
            method: "get",
            params: query,
        });
    }
}
